--
-- Author: ping.wang
-- Date: 2019-05-15 12:35:09
--
-- DailyworkflowModel
--

local fileName = string.getModeName(...)
local ClassRef = class(fileName, app.mvc.ModelBase)

function ClassRef:ctor(data)
    self.super.ctor(self, data)
end

function ClassRef:init()
end

------------------------ receive ------------------------
function ClassRef:reqDailyTimelineInfo()
    app.session:request("action.C2S_ActivityCalendar", {}, function(msg)

        self._timeLineServerInfo = {}
        for k, v in ipairs(msg.info) do
            self._timeLineServerInfo[tostring(v.id)] = {state = v.state, max = v.max}
        end

        --通知去刷新界面
        app:sendMsg("DailyworkflowController", "refreshDailyTimelinePanel", msg)
    end,{block = true})
end



function ClassRef:reqDailyRoutineInfo()
    app.session:request("pb_newspaper.C2S_GetDailyRoutine", {}, function(msg)
        --通知去刷新界面
        app:sendMsg("DailyworkflowController", "refreshDailyTimelinePanel", msg)
    end,{block = true})
end

function ClassRef:reqWeekRoutineInfo()
    app.session:request("pb_newspaper.C2S_GetWeeklyRountine", {}, function(msg)
        --通知去刷新界面
        app:sendMsg("DailyworkflowController", "refreshDailyTimelinePanel", msg)
    end,{block = true})
end

------------------------ request ------------------------

return ClassRef
